From: kaf24@scramble.cl.cam.ac.uk Date: Fri, 26 Mar 2004 19:57:09 +0000 (+0000) Subject: bitkeeper revision 1.825.3.9 (40648b15Z2oQl7l-e-LvK-_LuJdOVA) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18253^2~12 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=ee015a7a30477f6d3c7c7fa4e9a027f33eac2de5;p=xen.git bitkeeper revision 1.825.3.9 (40648b15Z2oQl7l-e-LvK-_LuJdOVA) console.c: Back to ctrl-a for console redirect but pass the sequence up and just count it. --- diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 2eeb70cf89..b313f59b3a 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -227,8 +227,8 @@ long read_console_ring(unsigned long str, unsigned int count, unsigned cmd) static char serial_rx_ring[SERIAL_RX_SIZE]; static unsigned int serial_rx_cons, serial_rx_prod; -/* CTRL-g switches input direction between Xen and DOM0. */ -#define CTRL_G 0x07 +/* CTRL-a switches input direction between Xen and DOM0. */ +#define CTRL_A 0x01 static int xen_rx = 1; /* FALSE => serial input passed to domain 0. */ static void switch_serial_input(void) @@ -236,7 +236,7 @@ static void switch_serial_input(void) static char *input_str[2] = { "DOM0", "Xen" }; xen_rx = !xen_rx; printk("*** Serial input -> %s " - "(type 'CTRL-g' three times to switch input to %s).\n", + "(type 'CTRL-a' three times to switch input to %s).\n", input_str[xen_rx], input_str[!xen_rx]); } @@ -264,25 +264,24 @@ static void __serial_rx(unsigned char c, struct pt_regs *regs) static void serial_rx(unsigned char c, struct pt_regs *regs) { - static int ctrl_g_count = 0; + static int ctrl_a_count = 0; - if ( c == CTRL_G ) + if ( c == CTRL_A ) { - /* We eat CTRL-g in groups of three to switch console input. */ - if ( ++ctrl_g_count == 3 ) + /* We eat CTRL-a in groups of three to switch console input. */ + if ( ++ctrl_a_count == 3 ) { switch_serial_input(); - ctrl_g_count = 0; + ctrl_a_count = 0; } } else { - /* Flush any pending CTRL-b's. They weren't for us. */ - for ( ; ctrl_g_count != 0; ctrl_g_count-- ) - __serial_rx(CTRL_G, regs); - /* Finally process the just-received character. */ - __serial_rx(c, regs); + ctrl_a_count = 0; } + + /* Finally process the just-received character. */ + __serial_rx(c, regs); } long do_console_io(int cmd, int count, char *buffer)